{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**产生1个正态分布的随机数据**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAD8CAYAAABw1c+bAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvqOYd8AAAGd9JREFUeJzt3X+QXfV53/H3B2lxVtj1ymZN0CJZNGXkOKYg5w6xq6mHH+GHsWspxElgph41JaM4A62dODQi7RhKOoM6OG4zxWOGggqeUIxrg6wEYqFBniFOHcIKiYIsKBTjsCsVrSMEuNrWK+npH3uudHV17t3785xz7/m8Znb2nnPPved7+fHc7z7nOc9XEYGZmZXHaXkPwMzMsuXAb2ZWMg78ZmYl48BvZlYyDvxmZiXjwG9mVjIO/GZmJePAb2ZWMg78ZmYlszjvAaQ588wzY+XKlXkPw8xsYOzcufPHETHeyrGFDPwrV65kcnIy72GYmQ0MST9q9dgFUz2Slkv6rqS9kvZI+lyy/z2Stkt6Kfm9tMHr1yfHvCRpfesfw8zM+qGVHP8R4AsR8fPAR4AbJH0Q2Ag8ERHnAU8k2yeR9B7gFuCXgIuAWxp9QZiZWTYWDPwRsT8inkkevw3sBSaAtcD9yWH3A+tSXn4lsD0iDkbEG8B24KpeDNzMzDrTVlWPpJXAauAp4KyI2A/zXw7A+1JeMgG8VrM9lewzM7OctBz4Jb0T+Bbw+Yh4q9WXpexLXQBA0gZJk5ImZ2ZmWh2WmZm1qaXAL2mE+aD/QEQ8nOx+XdLZyfNnAwdSXjoFLK/ZPgfYl3aOiLg7IioRURkfb6kiycxsYGzZNc2aTTs4d+OjrNm0gy27pnMbSytVPQLuBfZGxJdrntoKVKt01gPfTnn5NuAKSUuTi7pXJPvMz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StBFYDT+U7ksz9R+BfAcfyHkgO/j4wA/yXJNV1j6Qz8h5UViJiGvgS8LfAfuDNiHg831Hl4qyI2A/zk0Hgfe2+waAFfqXsK11ZkqR3At8CPh8Rb+U9nqxI+iRwICJ25j2WnCwGPgx8NSJWA/+HDv7MH1RJLnstcC6wDDhD0j/Nd1SDadAC/xSwvGb7HIb8T716kkaYD/oPRMTDeY8nY2uAT0l6lfk036WS/jTfIWVqCpiKiOpfed9k/ougLH4Z+GFEzETEHPAw8I9yHlMeXpd0NkDy+0C7bzBogf9p4DxJ50o6nfkLO1tzHlNmJIn5/O7eiPhy3uPJWkTcHBHnRMRK5v/d74iI0sz4IuJ/A69JWpXsugz4QY5DytrfAh+RtCT5f+EySnRxu8ZWYH3yeD3w7XbfYKDW3I2II5JuBLYxf0V/c0TsyXlYWVoDfAZ4TtLuZN8fRsRjOY7JsvUvgAeSic8rwG/mPJ7MRMRTkr4JPMN8hdsuhvwuXkkPAhcDZ0qaAm4BNgHfkHQ981+Gv9b2+/rOXTOzchm0VI+ZmXXJgd/MrGQc+M3MSsaB38ysZBz4zcxKxoHfzKxkHPjNzErGgd/MrGT+Py8bUJWs6lc3AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "rng = np.random.RandomState(42) # 此命令将会产生一个随机状态种子,在该状态下生成的随机序列（正态分布）一定会有相同的模式。\n",
    "                                # 但是，不同的随机种子状态将会有不同的数据生成模式。这一特点在随机数据生成的统计格式控制显得很重要。 \n",
    "x = 10 * rng.rand(50)\n",
    "y = 2 * x - 1 + rng.randn(50)\n",
    "plt.scatter(x, y);"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**导入线性回归模块**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.linear_model import LinearRegression"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**实例化LinearRegression类并用fit_intercept超参数设置是否想要拟合直线的截距**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LinearRegression(copy_X=True, fit_intercept=True, n_jobs=1, normalize=False)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model = LinearRegression(fit_intercept=True)\n",
    "model"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**将数据整理成特征矩阵和目标数组**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(50, 1)"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X = x[:, np.newaxis]\n",
    "X.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**用模型拟合数据**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LinearRegression(copy_X=True, fit_intercept=True, n_jobs=1, normalize=False)"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.fit(X, y)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**fit()命令会在模型内部进行大量运算，运算结果将存储在模型属性中，供用户使用。\n",
    "在Scikit-Learn中，所有通过fit()方法获得的模型参数都带一条下划线。**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1.9776566])"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.coef_   ## 对样本数据拟合直线的斜率"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-0.903310725531111"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.intercept_    ## 对样本数据拟合直线的截距"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**预测新数据的标签**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "xfit = np.linspace(-1, 11)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-1.        , -0.75510204, -0.51020408, -0.26530612, -0.02040816,\n",
       "        0.2244898 ,  0.46938776,  0.71428571,  0.95918367,  1.20408163,\n",
       "        1.44897959,  1.69387755,  1.93877551,  2.18367347,  2.42857143,\n",
       "        2.67346939,  2.91836735,  3.16326531,  3.40816327,  3.65306122,\n",
       "        3.89795918,  4.14285714,  4.3877551 ,  4.63265306,  4.87755102,\n",
       "        5.12244898,  5.36734694,  5.6122449 ,  5.85714286,  6.10204082,\n",
       "        6.34693878,  6.59183673,  6.83673469,  7.08163265,  7.32653061,\n",
       "        7.57142857,  7.81632653,  8.06122449,  8.30612245,  8.55102041,\n",
       "        8.79591837,  9.04081633,  9.28571429,  9.53061224,  9.7755102 ,\n",
       "       10.02040816, 10.26530612, 10.51020408, 10.75510204, 11.        ])"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "xfit"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**将这些x值转换成[n_samples, n_fea-tures]的特征矩阵形式，之后将其输入到模型中**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "Xfit = xfit[:, np.newaxis]\n",
    "yfit = model.predict(Xfit)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**把原始数据和拟合结果都可视化出来**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvqOYd8AAAIABJREFUeJzt3Xl8lNXZxvHfyUZCWCIkbJEYRFZZRCMuuG+4y1Lfalu1rdVqa63WFwhqK9VWUFvR165obW21WksAEVEKaEWtWxBJAoRFQCAJSQBDAklIMnPeP5LQkMwkk5nJrNf3H5Ink8w9H+DKmfOccx9jrUVERMJfTLALEBER/1Cgi4hECAW6iEiEUKCLiEQIBbqISIRQoIuIRAgFuohIhFCgi4hECAW6iEiEiAvkk6WmptrMzMxAPqWISNhbu3btPmttWkePC2igZ2ZmkpubG8inFBEJe8aYLz15nKZcREQihAJdRCRCKNBFRCKEAl1EJEIo0EVEIoQCXUQkQijQRUQihAJdRKQLfXW4jp+/voHK2vouf66AbiwSEYkW1lqW5+/loaUFVFTXM2loKpeM7t+lz6lAFxHxs7LKWh5cUsC/NpYyNr03f7v1DEYN7NXlz6tAFxHxE2st/8zdwyNvbKSuwcnsK0Zy6zlDiIsNzOy2Al1ExA927a/m/sX5vL9tHxOH9OGx6eMYkpoc0Bo6DHRjzGDgr8AAwAkssNY+bYzpA/wDyAR2Av9jrf2q60oVEQk9DqflL//Zya9WbCY2xvCLKWP4xsQMYmJMwGvxZITeANxnrf3MGNMTWGuMWQl8G1htrZ1njMkGsoFZXVeqiEho2VpaxcycPNbtquCikf34xZQxDEpJClo9HQa6tbYEKGn6uMoYswlIB64DLmh62AvAv1Ggi0gUqGtw8od3v+CZt7fSo1scT99wCteOH4QxgR+Vt9SpO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axcFux4vTQKuNcbspHEK7CJjzIvBLclre4A91trmd0oLaQz4cHQJsMNaW26trQcWAWcHuSZflRpjBgI0/VkW5Hq8pkBv9CkwzBgzxBiTQONNnqVBrskrxhhD41ztJmvtk8Gux1vW2tnW2uOttZk0/n28ba0Ny5GgtXYvsNsYM6Lp0sXAxiCW5ItdwJnGmO5N/9YuJkxv8LawFLil6eNbgNeCWItP4oJdQCiw1jYYY+4CVtB41/55a+2GIJflrUnATUC+Mebzpmv3W2uXB7EmgR8BLzUNGLYD3wlyPV6x1n5sjFkIfEbjiqp1hNFOS2PMy8AFQKoxZg/wEDAPeNUYcyuNv7CuD16FvtFOURGRCKEpFxGRCKFAFxGJEAp0EZEIoUAXEYkQCnQRkQihQBcRiRAKdBGRCKFAFxGJEP8P9LIV7SpG0McAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(x, y)\n",
    "plt.plot(xfit, yfit);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
